<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" method="post" action="index.php?c=Present&a=presentsList">
    <input type="hidden" name="pageNum" value="<?php echo ($param["pageNum"]); ?>" />
    <input type="hidden" name="keywords" value="<?php echo ($param["keywords"]); ?>">
    <input type="hidden" name="numPerPage" value="<?php echo ($param["numPerPage"]); ?>" />
    <input type="hidden" name="orderField" value="<?php echo ($param["orderField"]); ?>" />
</form>
<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="index.php?c=Index&a=goodList" method="post">
        <div class="searchBar">

            <div class="subBar">
                <ul>
                    <li><a class="button" href="index.php?c=Present&a=search" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li>
                </ul>
            </div>
        </div>
    </form>
</div>

<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="add" onclick="submited(1,this)" target="" width="800" height="600" warn="确定通过吗？"><span>审核通过</span></a></li>
            <li><a class="delete" onclick="submited(0,this)" target="" width="800" height="600" warn="确定不通过吗？"><span>不通过</span></a></li>

        </ul>
    </div>

    <div id="w_list_print">
    <form id="tables" action="index.php?c=Present&a=presentCheck" method="post" accept-charset="utf-8">
        <table class="list" width="98%" targetType="navTab" asc="asc" desc="desc" layoutH="116">
            <thead>
            <tr>
                <th align="center" width="10" ><input class="checkedAll" type="checkbox"/></th>
                <th align="center" width="80" orderField="id" >ID / 流水详情</th>
                <th align="center" width="100" orderField="account_money">提现金额</th>
                <th align="center" width="100" orderField="">提现时间</th>
                <th align="center" width="100">提现用户</th>
                <th align="center" width="100">提现方式</th>
                <th align="center" width="100">提现账号</th>
                <th align="center" width="100">提现银行</th>
                <th align="center" width="100">提现状态</th>
                <th align="center" width="100">到账时间</th>
                <th align="center" width="100">操作</th>
            </tr>
            </thead>
            <tbody id="Fares">

            <?php if(is_array($presents)): $i = 0; $__LIST__ = $presents;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$present): $mod = ($i % 2 );++$i;?><tr target="<?php echo ($present["id"]); ?>" rel="1">
               <td>
                 <?php if(($present["account_state"] != 1) AND ($present["account_state"] != 2)): ?><input type="checkbox" name="presents[]" value="<?php echo ($present["id"]); ?>"><?php endif; ?>
               </td>
               <td><a href="index.php?c=Present&a=moneyDetail&id=<?php echo ($present["id"]); ?>" sag="<?php echo ($present["sid"]); ?>" style="color:purple"><?php echo ($present["id"]); ?></a></td>
               <td><?php echo ($present["account_money"]); ?></td>
               <td><?php echo ($present["created_at"]); ?></td>
               <td><?php echo ($present["realname"]); ?></td>
               <td>
                   <?php if($present["account_method"] == 1): ?>支付宝
                   <?php elseif($present["account_method"] == 2): ?>
                   微信
                   <?php elseif($present["account_method"] == 3): ?>
                   银行卡<?php endif; ?>
               </td>
               <td><?php echo ($present["account"]); ?></td>
               <td><?php if($present["account_bank"] == null): ?>无<?php endif; ?>
                <?php if(is_array($banks)): $i = 0; $__LIST__ = $banks;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$bank): $mod = ($i % 2 );++$i; if($bank['id'] == $present['account_bank']) echo $bank['bank_name']; endforeach; endif; else: echo "" ;endif; ?>
               </td>
               <td>
                  <?php if($present["account_state"] == 1): ?>提现成功
                  <?php elseif($present["account_state"] == 2): ?>
                  提现失败
                  <?php else: ?>
                  审核中<?php endif; ?>
               </td>
               <td><?php echo ($present["updated_at"]); ?></td>
               <td><?php if($present["account_state"] == 2): ?><a class="add" href="index.php?c=Present&a=presentDetail&id=<?php echo ($present["id"]); ?>"  target="dialog" width="800" height="600"><span>查看详情</span></a><?php endif; ?></td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
        </table>
        <input type="hidden" name='checking' />
    </form>
    </div>

    <div class="panelBar" >
        <div class="pages">
            <span>显示</span>
            <select name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
                <option value="200">200</option>
            </select>
            <!-- <span>条，共<?php echo ($param["count"]); ?>条&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> -->
            <span>流水合计<?php echo ($presents["total"]); ?>元</span>
        </div>

        <div class="pagination" targetType="navTab" totalCount="<?php echo ($param["count"]); ?>" numPerPage="<?php echo ($param["numPerPage"]); ?>" pageNumShown="10" currentPage="<?php echo ($param["pageNum"]); ?>"></div>

    </div>

</div>
<script>
  $('td').attr({align:"center"});
  $('.checkedAll').on({
    change:function(){
      $(this).prop('checked')?$(":checkbox[name='presents[]']").prop('checked',true):$(":checkbox[name='presents[]']").prop('checked',false);
    },
  });
    //删除回调
  function submited(url,th){
    alert(th);
    if( $(":checkbox:checked").not($('.checkedAll')).length>0 ){
      if(url=='0'){
        var w = confirm($(th).attr('warn'))?'1':'';
        $(":input[name='checking']").val('0');
      }else if(url=='1'){
        var w = confirm($(th).attr('warn'))?'1':'';
        $(":input[name='checking']").val('1');
      }
      if(w){
        $('#tables').submit();
      }
    }else{
      return false;
    }
  }
    //删除回调
    function Delcb(){
        $deltr = $('#Fares').find('tr.selected');
        $deltr.remove();
    }
</script>